
all: lect2b
	
lect2b:
	bison interpreter.ypp # to create C++ file interpreter.tab.cpp
	bison -d program.y # to create header file program.tab.h for lexer
	flex program.l
	gcc -c lex.yy.c # create the object file lex.yy.o
	g++ interpreter.tab.cpp program.cpp lex.yy.o -o interpreter # create the object file lex.yy.o 

clean:
	rm -rf *o lect2b*
	rm -rf *.tab.*
	rm -rf lex.yy.c
	rm -rf interpreter
	rm -rf tprog
	rm -rf tstmt
	rm -rf tstmtlist

buildtest1:
	g++ program.cpp tprog.cpp -o tprog # create the object file lex.yy.o 

test1:
	./tprog

buildtest2:
	g++ program.cpp tstmt.cpp -o tstmt # create the object file lex.yy.o 

test2:
	./tstmt

buildtest3:
	g++ program.cpp tstmtlist.cpp -o tstmtlist # create the object file lex.yy.o 

test3:
	./tstmtlist